home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / wasm223.zip / CASE2.ASM < prev    next >
Assembly Source File  |  1993-05-04  |  2KB  |  52 lines

  1. ;**********************************;
  2. ; WASM Case Conversion, String     ;
  3. ; By Eric Tauck                    ;
  4. ;                                  ;
  5. ; Defines:                         ;
  6. ;                                  ;
  7. ;   StrLwr  string to lowercase    ;
  8. ;   StrUpr  string to uppercase    ;
  9. ;                                  ;
  10. ; Requires:                        ;
  11. ;                                  ;
  12. ;   CASE1.ASM                      ;
  13. ;**********************************;
  14.  
  15.         jmps    _case2_end
  16.  
  17. ;========================================
  18. ; Convert a string to lowercase.
  19. ;
  20. ; In: AX= address of string.
  21.  
  22. StrLwr  PROC    NEAR
  23.         mov     bx, ax          ;address into BX
  24.         jmps    _srlwr2         ;enter loop
  25. _srlwr1 call    ChrLwr          ;convert to lowercase
  26.         mov     [bx], al        ;store character
  27.         inc     bx              ;increment address
  28. _srlwr2 mov     al, [bx]        ;load character
  29.         or      al, al          ;check if end of string
  30.         jnz     _srlwr1         ;loop back if not
  31.         ret
  32.         ENDP
  33.  
  34. ;========================================
  35. ; Convert a string to uppercase.
  36. ;
  37. ; In: AX= address of string.
  38.  
  39. StrUpr  PROC    NEAR
  40.         mov     bx, ax          ;address into BX
  41.         jmps    _srupr2         ;enter loop
  42. _srupr1 call    ChrUpr          ;convert to uppercase
  43.         mov     [bx], al        ;store character
  44.         inc     bx              ;increment address
  45. _srupr2 mov     al, [bx]        ;load character
  46.         or      al, al          ;check if end of string
  47.         jnz     _srupr1         ;loop back if not
  48.         ret
  49.         ENDP
  50.  
  51. _case2_end
  52.